﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ScoreInMonth.aspx.cs" Inherits="Credit_Teacher_Reprots_ScoreInMonth" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../../Common/css/main.css" rel="stylesheet" type="text/css" />
</head>
<body SCROLL="no" id="bodyest" style="height: 90%; padding-top: 5px; padding-left: 5px; overflow-y: none; overflow-x: none;">
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
        </asp:ScriptManager>
        <div class="mainWarp" style="width: 100%; height: 99%;">
        <div class="pageBody">
            
                <table>
                    <tr>
                        <td style="padding-left: 4px;">
                            学年学期：
                            <asp:DropDownList ID="selYear" runat="server" AutoPostBack="true" OnTextChanged="selYear_TextChanged">
                            </asp:DropDownList>
                        </td>
                        <td style="padding-left: 4px;">
                            <asp:UpdatePanel ID="upClass" runat="server">
                                <ContentTemplate>
                                    班级：<asp:DropDownList ID="selClass" runat="server">
                                    </asp:DropDownList>
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="selYear" EventName="TextChanged" />
                                </Triggers>
                            </asp:UpdatePanel>
                        </td>
                        <td style="padding-left: 4px;">
                            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                <ContentTemplate>
                                    月份：<asp:DropDownList ID="selSubject" runat="server">
                                    </asp:DropDownList>
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="selYear" EventName="TextChanged" />
                                </Triggers>
                            </asp:UpdatePanel>
                        </td>
                        <td style="padding-left: 10px;">
                            <asp:Button class="commonBut" ID="btnQuery" runat="server" Text="查询" OnClick="btnQuery_Click" />
                        </td>
                        <td style="padding-left: 10px;">
                            <input id="Button2" type="button" value="导出Excel" class="commonBut" style="display: block;"
                                onclick="getExcel()" />
                        </td>
                    </tr>
                </table>
                <div style="overflow-y:auto;overflow-x:none;height:98%;">
                <div id="divTable" style="width:600px;  height:300px; margin:left; overflow: auto;position: relative;">
                    <asp:UpdatePanel ID="upResult" runat="server">
                        <ContentTemplate>
                            <asp:Table ID="tbResult" runat="server" CssClass="useList1" Style="margin-left: 5px;">
                            </asp:Table>
                        </ContentTemplate>
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="btnQuery" EventName="Click" />
                        </Triggers>
                    </asp:UpdatePanel>
                </div></div>
            </div>
        </div>
    </form>
    <div id="upInputPop" class="layoutWarp" style="display: none">
        <iframe src="" name="downloadf" id="downloadf" style="height: 80%; width: 95%; overflow-y: auto;
            overflow-x: none;" frameborder="0"></iframe>
    </div>
</body>

<script type="text/javascript" src="../../Common/js/TableForExport.js"></script>

<script type="text/javascript">
    function getExcel() {
        var cells = GetTableInfo(document.getElementById("<%=tbResult.ClientID %>"));
        if(cells!=null)
        {            
            PageMethods.GetExcel(cells,function(result){
            document.getElementById('downloadf').src = "";
            document.getElementById('downloadf').src = "../../../PostFileBytes.aspx";
            },function(err){alert(err._message);});
        }
    }
</script>
<script language="javascript">
    function resizeTable(){
        var h=0;
        var w=0;
        if(document.body.scrollHeight>document.getElementById("bodyest").clientHeight)
        {
            h = document.getElementById("bodyest").clientHeight;
        }
        else
        {
            h = document.body.scrollHeight;
        }
        if(document.body.scrollWidth>document.getElementById("bodyest").clientWidth)
        {
            w = document.getElementById("bodyest").clientWidth+20;
        }
        else
        {
            w = document.body.scrollWidth-30;
        }
        
        if(h>0 && w>0)
        {
            document.getElementById("divTable").style.height=h+"px";
            document.getElementById("divTable").style.width=w+"px";
        }
    }
    resizeTable();
</script>
</html>
